<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8"/>
    <title>Title</title>
</head>
<body>
<div th:fragment="header" class="header">
    <div class="container">
        <div class="header-grid" style="    padding: 0.5em 0;">
            <div class="header-grid-right animated wow slideInRight" data-wow-delay=".5s">
                <ul class="social-icons" id="social-icons1" >
                    <li><a href="/login">登陆</a></li>
                    <li><a href="/register">注册</a></li>
                </ul>
                <ul class="social-icons" id="social-icons2">
                    <li id="username"></li>
                    <li><a onclick="localStorage.removeItem('shopuserid');window.location.href='/login'">退出</a></li>
                </ul>
                <script>
                    if (localStorage.shopuserid){
                        console.log("true")
                        $("#username").text(localStorage.name);
                        $("#social-icons1").hide();
                        $("#social-icons2").show();
                    } else{
                        console.log("false")
                        $("#social-icons1").show();
                        $("#social-icons2").hide();
                    }
                </script>
            </div>
            <div class="clearfix"> </div>
        </div>
        <div class="logo-nav">
            <div class="logo-nav-left animated wow zoomIn" data-wow-delay=".5s">
                <h1><a href="/index">易购网 <span>YI GOU WANG</span></a></h1>
            </div>
            <div class="logo-nav-left1">
                <nav class="navbar navbar-default">
                    <!-- Brand and toggle get grouped for better mobile display -->
                    <div class="navbar-header nav_2">
                        <button type="button" class="navbar-toggle collapsed navbar-toggle1" data-toggle="collapse" data-target="#bs-megadropdown-tabs">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                    </div>
                    <div class="collapse navbar-collapse" id="bs-megadropdown-tabs">
                        <ul class="nav navbar-nav">
                            <li class="active"><a href="/index" class="act">主页</a></li>
                            <!-- Mega Menu -->
                            <li class="dropdown">
                                <a href="/products">所有商品</a>
                            </li>
                            <li><a href="/mail">个人中心</a></li>
                        </ul>
                    </div>
                </nav>
            </div>
            <div class="logo-nav-right">
                <div class="search-box">
                    <div id="sb-search" class="sb-search">
                        <form id="myForm" action="/goods/find/name" method="get">
                            <input class="sb-search-input" placeholder="请输入要搜索得内容" name="name" type="search" id="search"/>
                            <input class="sb-search-submit" type="submit" value=""/>
                            <span class="sb-icon-search"> </span>
                        </form>
                    </div>
                </div>
                <!-- search-scripts -->
                <script src="/js/classie.js"></script>
                <script src="/js/uisearch.js"></script>
                <script>
                    new UISearch( document.getElementById( 'sb-search' ) );
                </script>
                <!-- //search-scripts -->
            </div>
            <div class="header-right">

                <div class="cart box_1">
                    <a href="checkout.html">
                        <h3>
                            <!--<span class="simpleCart_total"></span> (<span id="simpleCart_quantity" class="simpleCart_quantity"></span> 商品)</div>-->
                            <img src="/images/bag.png" alt="" />
                        </h3>
                    </a>

                </div>
            </div>
            <div class="clearfix"> </div>
        </div>
    </div>
</div>
</body>
</html>